<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: edit_user.tpl.php 1151 2008-06-24 15:07:32Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

?>
<script type="text/javascript">
// <![CDATA[
<!--
function delpic() {
document.getElementById('picupload').src = "<?php echo _JOOMLA_JL_LIVE_SITE.'/'.JL_COMPONENT_LINK_NOHTML.'&func=del_userpic&p='.$joomleague->id.JL_ITEMID_SUFFIX.'&picture=';?>"+ document.adminForm.picture.value;
document.adminForm.picture.value='';
document.getElementById('showFile').innerHTML='<img src="<?php echo JL_URL_FOLDER;?>/images/placeholders/placeholder_150.png"; />';
}
//-->
// ]]>
</script>
<!-- Header with Project Name-->
<?php if ($showUser_config['show_project_heading'] == "1" OR $overall_config['show_project_heading'] == "1") { ?>
<div class="componentheading" <?php if ($showUser_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") echo 'style="float:left;"';?>><?php echo $htmlHelper->showTitle($joomleague, $overall_config['project_heading_type']); ?></div>
<!-- Druckfunktion -->
<?php if ($showUser_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") {
$htmlHelper->PrintIcon( $row, $params, false, '' );
};?>
<!-- Druckfunktion Ende -->
<?php } ?>
<!-- Header END -->

<!-- Bereichs�berschrift z.B Tabelle, Tippabgabe usw.  -->
<table width="100%" class="contentpaneopen">
	<tr>
		<td class="contentheading">
      <?php if ($showUser_config['show_full_name']==1) echo $user->name; else echo $user->username;?> 
<?php
	if ($allowed==1) {
		$htmlHelper->show_edit_icon_tipp();
	}
?>		
		</td>
	</tr>
</table>
<!-- Bereichs�berschrift Ende -->

<br />

<!-- Inhalt -->
<form action="<?php echo JL_COMPONENT_LINK;?>&amp;func=saveUser&amp;p=<?php echo $joomleague->id.JL_ITEMID_SUFFIX;?>" method="post" enctype="multipart/form-data" name="adminForm">
<!-- Main START -->
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
<?php if ($showUser_config['show_image_from']==1) { ?>
  <tr>
    <td colspan="2">
      <iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" id="picupload" src="<?php
      echo (is_null($user->picture)) ? _JOOMLA_JL_LIVE_SITE.'/'.JL_COMPONENT_LINK_NOHTML.'&amp;func=upload_form&amp;p='.$joomleague->id.JL_ITEMID_SUFFIX : '';
      ?>" style="border:0;width:100%; height:auto;overflow:hidden;"></iframe>
    </td>
  </tr>
<?php } ?>
  <tr>
<?php if($showUser_config['show_image_from']>0) echo '<td valign="top" align="left" width="15%">';?>  
    <div id="showFile" style="max-width:150px;max-height:150px;padding: 5px;">
<?php 
  if ($showUser_config['show_image_from']==1) {
      $database->setQuery(sprintf("SELECT avatar FROM #__comprofiler WHERE user_id = %s", $user->id));
      $cb_user_picture = $database->loadResult();   
      echo '<img src="'.$user_picture.'" border="0" id="userpicture" name="userpicture" alt="'.$user->name.'" style="max-width:150px;max-height:150px;padding: 5px" />';
      };
  if ($showUser_config['show_image_from']==2) {
      $database->setQuery(sprintf("SELECT avatar FROM #__fb_users WHERE userid = %s", $user->id));
      $fb_user_picture = $database->loadResult();  
      $database->setQuery(sprintf("SELECT avatar FROM #__comprofiler WHERE user_id = %s", $user->id));
      $cb_user_picture = $database->loadResult();
      echo '<img src="'._JOOMLA_JL_LIVE_SITE.'/images/comprofiler/'.$cb_user_picture.'" id="userpicture" name="userpicture" border="0" style="max-width:150px;max-height:150px;padding: 5px" alt="'.$user->name.'" />';
      } ;     
  if ($showUser_config['show_image_from']==3) {
      $database->setQuery(sprintf("SELECT avatar FROM #__fb_users WHERE userid = %s", $user->id));
      $fb_user_picture = $database->loadResult();
      echo '<img src="'._JOOMLA_JL_LIVE_SITE.'/components/com_fireboard/avatars/'.$fb_user_picture.'" border="0" style="max-width:150px;max-height:150px;padding: 5px" name="userpicture" id="userpicture" alt="'.$user->name.'" />';
      } ;?>    
      </div>
<?php if ($showUser_config['show_image_from']==1) {?> 
      <center>
      <input type="button" style="display:<?php echo (!(is_null($user->picture))) ? 'block' : 'none' ?>" class="button" id="delPicture" name="delPicture" value="<?php echo _JL_DELETE;?>" onclick="delpic();" /></center>
    <?php } ?>
      <input type="hidden" id="picture" name="picture" value="<?php echo $user->picture;?>" />
      <input type="hidden" id="oldpicture" name="oldpicture" value="<?php echo $user->picture;?>" />
<?php if($showUser_config['show_image_from']>0) echo '</td>';?>    
    <td valign="top" align="left">
      <table>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_MEMBER_SINCE;?>:</b></td><td>&nbsp;</td><td><?php echo mosFormatDate($user->registerDate, "%d.%m.%Y",0);?></td>
        </tr>
<?php if ($showUser_config['edit_favteam']==1) { ;?>        
        <tr>
          <td><b><?php echo _JL_USER_PAGE_FAV_TEAM;?>:</b></td><td>&nbsp;</td><td><?php echo $clist;?></td>
        </tr>
<?php } ;?>
<?php if ($showUser_config['edit_slogan']==1) { ;?>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_SLOGAN;?>:</b></td><td>&nbsp;</td><td><input class="inputbox" type="text" size="50" name="slogan" value="<?php echo $user->slogan; ?>"/></td>
        </tr>
<?php } ;?>        
        <tr>
        <td>&nbsp;</td>
        </tr>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_LAST_TIP;?>:</b></td><td>&nbsp;</td><td><?php echo mosFormatDate($user->lasttip, "%d.%m.%Y", 0); ?></td>
        </tr>
        <?php if($joomleague->tip_champ==1){;?>           
        <tr>
          <td><b><?php echo _JL_USER_PAGE_CHAMPTIP;?>:</b></td><td>&nbsp;</td><td>
          <?php
              $thistime=$joomleague->getTimestamp('',1);
              if ($saisonstart > $thistime) {
                 echo $tlist;
              } else {
                 echo $champ_tip;
              }
          ?>
          </td>
        </tr>
        <?php };?>
        <tr>
        <td>&nbsp;</td>
        </tr>
<?php if ($showUser_config['edit_reminder']==1) { ;?>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_REMINDER;?>?</b></td><td>&nbsp;</td><td><?php echo mosHTML::yesnoRadioList('reminder', '', $user->reminder );?></td>
        </tr>
<?php } ;?>
<?php if ($showUser_config['edit_receipt']==1) { ;?>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_RECEIPT;?>?</b></td><td>&nbsp;</td><td><?php echo mosHTML::yesnoRadioList('receipt', '', $user->receipt );?></td>
        </tr>
<?php } ;?>                      
<?php if ($doTips_config['use_tip_admin']==1) { ;?>
        <tr>
          <td><b><?php echo _JL_USER_PAGE_TIPADMIN;?>?</b></td><td>&nbsp;</td><td><?php echo mosHTML::yesnoRadioList('tipadmin', '', $user->tipadmin );?></td>
        </tr>
<?php } ;?>                      
      </table>
    </td>
  </tr>
</table>
<table width="100%">
	<tr>
		<td align="center">
           <input type="submit" class="button" name="saveResults" value="<?php echo _JL_SAVE;?>" />
           <input type="hidden" class="button" name="save_data" value="1" />
           <input type="submit" class="button" name="saveResults" value="<?php echo _JL_RESULTS_CANCEL;?>" onclick="document.adminForm.save_data.value='0'"/>
           <input type="hidden" name="p" value="<?php echo $joomleague->id;?>" />
           <input type="hidden" name="uid" value="<?php echo $user->id;?>" />
           <input type="hidden" name="option" value="com_joomleague" />
           <input type="hidden" name="func" value="saveUser" />
           <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />
		</td>
	</tr>
</table>
</form>
<!-- Print Button START -->
<?php if ($showUser_config['show_back_button'] > 0 OR $overall_config['show_back_button'] > 0) {;?>
<?php if ($showUser_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params = & new mosParameters( '' );
$params->def( 'back_button', true );
$params->def( 'popup', false );
mosHTML::BackButton( $params );
  echo "</div>";
};?>
<!-- Print Button END -->
